<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnWeekTypeInScheduleManageTable extends AbstractMigration
{
    public function up()
    {
        $this->table("schedule_manage")
            ->addColumn('week_type', 'string', ['default' => '', 'null' => false, 'limit' => 128, 'comment' => '是否周末'])
            ->save();
    }

    public function down()
    {
        $column1 = $this->table("schedule_manage")->hasColumn('week_type');
        if ($column1) {
            $this->table("schedule_manage")
                ->removeColumn('week_type')
                ->save();
        }
    }
}
